package edu.sctu.practice.class02.hujie.cgs.practice02.test13;

/**
 * Created by hj on 2015/10/23.
 */
public class Car {
    public int tyre;//tyre轮胎
    public String color;
    public float weight;

    //无参数的构造方法
    public Car() {
        this.tyre = 8;
        this.color = "green";
        this.weight = 5f;
    }

    //有参数的构造方法
    public Car(int tyre, String color, float weight) {
        this.tyre = tyre;
        this.color = color;
        this.weight = weight;
    }

    public void upspeed() {
        System.out.println("此汽车能加速");
    }

    public void downspeed() {
        System.out.println("此车能减速");
    }

    public void stop() {
        System.out.println("此车能停车");
    }

}
